@import '../../style/themes/default';
@import '../../style/mixins/index';

@message-prefix-cls: ~'@{c7n-prefix}-message';

.@{message-prefix-cls} {
  .reset-component;
  position: fixed;
  top: 0;
  left: 0;
  z-index: @zindex-message;
  pointer-events: none;

  &-notice {
    padding: 0.08rem;
    text-align: center;
    &:first-child {
      margin-top: -0.08rem;
    }
  }

  &-notice-content {
    display: inline-block;
    padding: 0.1rem 0.16rem;
    background: @component-background;
    border-radius: @border-radius-base;
    box-shadow: @shadow-2;
    pointer-events: all;
  }

  &-success .@{iconfont-css-prefix} {
    color: @success-color;
  }

  &-error .@{iconfont-css-prefix} {
    color: @error-color;
  }

  &-warning .@{iconfont-css-prefix} {
    color: @warning-color;
  }

  &-info .@{iconfont-css-prefix},
  &-loading .@{iconfont-css-prefix} {
    color: @info-color;
  }

  .@{iconfont-css-prefix} {
    position: relative;
    top: 0.01rem;
    margin-right: 0.08rem;
    font-size: @font-size-lg;
    vertical-align: top;
  }

  &-notice.move-up-leave.move-up-leave-active {
    overflow: hidden;
    animation-name: MessageMoveOut;
    animation-duration: 0.3s;
  }
}

@keyframes MessageMoveOut {
  0% {
    max-height: 1.5rem;
    padding: 0.08rem;
    opacity: 1;
  }
  100% {
    max-height: 0;
    padding: 0;
    opacity: 0;
  }
}
